package cn.controller.product;

import cn.service.productService.ProductServiceImpl.AttributeValueServiceImpl;
import entity.productEntity.AttributeValue;
import entity.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 朱颢阳
 * @description
 * @time 2024/8/21 9:44
 */
@RestController
@CrossOrigin
@RequestMapping("/product")
public class AttributeValueController {
    @Autowired
    AttributeValueServiceImpl service;
    @RequestMapping("/selectAttributeValueAll")
    public Result selectAttributeValueAll(Integer id,Integer currentPage, Integer pageSize){
        return service.selsectAll(id,currentPage,pageSize);
    }
    @RequestMapping("/selectAttAll")
    public Result selectAttAll(){
        return service.selectAttAll();
    }
    @RequestMapping("/insertAttributevalue")
    public Result insertAttributevalue(@RequestBody AttributeValue attributeValue){
        return service.insertAttributevalue(attributeValue);
    }
    @RequestMapping("/deleteAttributevalue")
    public Result deleteAttributevalue(Integer id, Integer attid){
        return service.deleteByid(id,attid);
    }
    @RequestMapping("/updataAttributevalue")
    public Result updataAttributevalue(@RequestBody AttributeValue attributevalue){
        return service.updataAttributeValue(attributevalue);
    }
    @RequestMapping("/getAttributevalues")
    public Result getAttributevalues(Integer id){
        return service.getAttributevalues(id);
    }
}
